package se.thoka.twt.shared.item;

import java.util.Collection;

import se.thoka.twt.shared.exceptions.IllegalOperationException;
import se.thoka.twt.shared.utils.HasId;

import com.google.gwt.user.client.rpc.AsyncCallback;

public interface ItemServiceAsync<T extends HasId> {

	void delete(T entity, AsyncCallback<Void> callback) throws IllegalOperationException;

	void insert(T entity, AsyncCallback<T> callback) throws IllegalOperationException;

	void selectAll(AsyncCallback<Collection<T>> callback) throws IllegalOperationException;

	void selectById(String id, AsyncCallback<T> callback) throws IllegalOperationException;

	void update(T entity, AsyncCallback<T> callback) throws IllegalOperationException;
}
